<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue v-html 指令</title>
</head>

<body>
    <!--快捷输入 div#app.app<tab> -->
    <div id="app" class="app">
        <h1 style="background-color: red;" v-text="msg"></h1>
        <div v-html="content"></div>
        <div v-text="content"></div>
    </div>
    <script type="module">
        import { createApp, ref } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'

        let app = createApp({
            setup() {
                let msg = "Hello, World!"
                let content = "<h1>Hello, Vue!</h1>"
                return {
                    msg,
                    content,
                }
            }
        })

        // 挂载——将 Javascript 代码和 html 通过 选择器 关联
        app.mount("#app")

    </script>
</body>

</html>